<?php
/**
 *	[TWCMS] (C)2012 TongWang Inc.
 *	$Id: index.php 2 2013-04-27 07:14:17Z nanown@qq.com $
 */
defined('IN_TWCMS') || exit('Access Denied');

$_ENV = new tpl();
$_ENV->theme = empty($_ENV->G['theme']) ? 'default' : $_ENV->G['theme'];
$_ENV->tpl_dir = TWCMS_THEME.$_ENV->theme.D;
$_ENV->php_dir = TWCMS_TPLCACHE;

$_ENV->V = $_ENV->TV = array();
$_ENV->V['cid'] = $_ENV->V['upid'] = $_ENV->V['topcid'] = 0;

$_ENV->G['keywords'] = &$_ENV->G['seokeywords'];
$_ENV->G['description'] = &$_ENV->G['seodescription'];
$_ENV->G['html_dir'] = empty($_ENV->G['html_dir']) ? '' : trim($_ENV->G['html_dir'], '/\\').'/';

if(empty($_GET['u'])) {
	$_ENV->V['topcid'] = -1;
	$tpn = 'index.htm';
}else{
	$_ENV->U = explode(P, $_GET['u']);
	$tpn = lead();
}
$_ENV->display($tpn);